# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Compute.V1.Model.BfdPacket do
  @moduledoc """


  ## Attributes

  *   `authenticationPresent` (*type:* `boolean()`, *default:* `nil`) - The Authentication Present bit of the BFD packet. This is specified in section 4.1 of RFC5880
  *   `controlPlaneIndependent` (*type:* `boolean()`, *default:* `nil`) - The Control Plane Independent bit of the BFD packet. This is specified in section 4.1 of RFC5880
  *   `demand` (*type:* `boolean()`, *default:* `nil`) - The demand bit of the BFD packet. This is specified in section 4.1 of RFC5880
  *   `diagnostic` (*type:* `String.t`, *default:* `nil`) - The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880
  *   `final` (*type:* `boolean()`, *default:* `nil`) - The Final bit of the BFD packet. This is specified in section 4.1 of RFC5880
  *   `length` (*type:* `integer()`, *default:* `nil`) - The length of the BFD Control packet in bytes. This is specified in section 4.1 of RFC5880
  *   `minEchoRxIntervalMs` (*type:* `integer()`, *default:* `nil`) - The Required Min Echo RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880
  *   `minRxIntervalMs` (*type:* `integer()`, *default:* `nil`) - The Required Min RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880
  *   `minTxIntervalMs` (*type:* `integer()`, *default:* `nil`) - The Desired Min TX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880
  *   `multiplier` (*type:* `integer()`, *default:* `nil`) - The detection time multiplier of the BFD packet. This is specified in section 4.1 of RFC5880
  *   `multipoint` (*type:* `boolean()`, *default:* `nil`) - The multipoint bit of the BFD packet. This is specified in section 4.1 of RFC5880
  *   `myDiscriminator` (*type:* `integer()`, *default:* `nil`) - The My Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880
  *   `poll` (*type:* `boolean()`, *default:* `nil`) - The Poll bit of the BFD packet. This is specified in section 4.1 of RFC5880
  *   `state` (*type:* `String.t`, *default:* `nil`) - The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880
  *   `version` (*type:* `integer()`, *default:* `nil`) - The version number of the BFD protocol, as specified in section 4.1 of RFC5880.
  *   `yourDiscriminator` (*type:* `integer()`, *default:* `nil`) - The Your Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authenticationPresent => boolean() | nil,
          :controlPlaneIndependent => boolean() | nil,
          :demand => boolean() | nil,
          :diagnostic => String.t() | nil,
          :final => boolean() | nil,
          :length => integer() | nil,
          :minEchoRxIntervalMs => integer() | nil,
          :minRxIntervalMs => integer() | nil,
          :minTxIntervalMs => integer() | nil,
          :multiplier => integer() | nil,
          :multipoint => boolean() | nil,
          :myDiscriminator => integer() | nil,
          :poll => boolean() | nil,
          :state => String.t() | nil,
          :version => integer() | nil,
          :yourDiscriminator => integer() | nil
        }

  field(:authenticationPresent)
  field(:controlPlaneIndependent)
  field(:demand)
  field(:diagnostic)
  field(:final)
  field(:length)
  field(:minEchoRxIntervalMs)
  field(:minRxIntervalMs)
  field(:minTxIntervalMs)
  field(:multiplier)
  field(:multipoint)
  field(:myDiscriminator)
  field(:poll)
  field(:state)
  field(:version)
  field(:yourDiscriminator)
end

defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.BfdPacket do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.BfdPacket.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.BfdPacket do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
